package com.ming_za.od_updater_sdk.event;

import com.ming_za.od_updater_sdk.obj.Res;

import java.io.InputStream;
import java.io.OutputStream;

public class UpdatingEvent extends UpdateEvent{

    /**
     * 资源文件总大小
     */
    private final long fileSize;
    /**
     * 输入流，如果{@link Res#isDelete()}==true，该参数则为null，此输入流更新完成后自动调用{@link InputStream#close()}
     */
    private final InputStream inputStream;
    /**
     * 输出流，如果{@link Res#isDelete()}==true，该参数则为null,此输出流更新完成后自动调用{@link OutputStream#close()}
     */
    private final OutputStream outputStream;

    public UpdatingEvent(Res res, int version, long fileSize, InputStream inputStream, OutputStream outputStream) {
        super(res, version);
        this.fileSize = fileSize;
        this.inputStream = inputStream;
        this.outputStream = outputStream;
    }

    public long getFileSize() {
        return fileSize;
    }

    public InputStream getInputStream() {
        return inputStream;
    }

    public OutputStream getOutputStream() {
        return outputStream;
    }
}
